package com.chuang.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chuang.server.pojo.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author vicente
 * @since 2021-12-14
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @MapKey("id")
    List<Map<Object, Object>> selectAll();
    @MapKey("id")
    Map<Object,Object> selectUserById(@Param("id") int id);
    int addUser(User user);
    int deleteById(int id);

    User selectUserByName(String name);

    int register(@Param("name") String name, @Param("loginName") String loginName, @Param("loginPassword") String loginPassword, @Param("quota") Long quota);

    IPage<User> selectPageVo(Page<?> page, @Param("state")Integer state);

}
